#pragma once

#include <AVUIIServiceProvider.h>
#include <AVUIIProvideValueTarget.h>

namespace AVUI {

// WPFG Significant deviation here, this should support more interfaces required to make ParserContext work
class ProvideValueServiceProvider : public Object, public IServiceProvider, public IProvideValueTarget
{
public:
    ProvideValueServiceProvider() { };

    void ClearData() { m_pTargetObject = m_pTargetProperty = NULL; }
    void SetData(Object* pTargetObject, Object* pTargetProperty)
    {
        m_pTargetObject = pTargetObject; m_pTargetProperty = pTargetProperty; 
    }

    TRefCountedPtr<Object> GetService(const Type* pService) { if(pService == &GET_TYPE(IProvideValueTarget)) return this; return NULL; }

    virtual Object* get_TargetObject() AVUI_OVERRIDE { return m_pTargetObject; }
    virtual Object* get_TargetProperty() AVUI_OVERRIDE { return m_pTargetProperty; }

private:
    TRefCountedPtr<Object> m_pTargetObject;
    TRefCountedPtr<Object> m_pTargetProperty;
};

}; // namespace AVUI

